home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / mipsABI / examples / after / gettime.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  373 b   |  23 lines

  1. /*
  2.  * illustrates the use of the gettimeofday routine
  3.  *
  4.  * If _ABI_SOURCE is defined, exclude the declaration of ``tz''
  5.  * and call gettimeofday with only one argument
  6.  */
  7.  
  8. #include <sys/time.h>
  9.  
  10. main ()
  11. {
  12.     struct timeval tv;
  13. #ifndef _ABI_SOURCE
  14.     struct timezone tz;
  15. #endif /* _ABI_SOURCE */
  16.  
  17. #ifdef _ABI_SOURCE
  18.     gettimeofday(&tv);
  19. #else
  20.     gettimeofday(&tv, &tz);
  21. #endif
  22. }
  23.